//
//  WMSheetView.h
//  SheetView
//
//  Created by 禹昊 on 2019/1/7.
//  Copyright © 2019年 禹昊. All rights reserved.
//

#import <UIKit/UIKit.h>
@class WMSheetView;
typedef enum : NSUInteger {
    maxDisplay,
    minDisplay
} WMBottomSheetState;

@protocol WMBottomSheetViewDelegate <NSObject>
- (void)state:(WMSheetView *)bottomSheet willDisplayState:(WMBottomSheetState)state;
- (void)state:(WMSheetView *)bottomSheet didDisplayedSate:(WMBottomSheetState)state;
@end
NS_ASSUME_NONNULL_BEGIN

@interface WMSheetView : UIView
@property (nonatomic, weak) id<WMBottomSheetViewDelegate> delegate;
//默认最小内容高度，当contentSize.height更小时，会更新mininumDisplayHeight值
@property (nonatomic, assign) CGFloat defaultMininumDisplayHeight;
//默认最大内容高度，当contentSize.height更小时，会更新maxinumDisplayHeight值
@property (nonatomic, assign) CGFloat defaultMaxinumDisplayHeight;
@property (nonatomic, assign) WMBottomSheetState displayState;
//1、判断triggerVelocity，大于当前切换方向，直接切换；
//2、判断triggerDistance：
//2.1、当超过triggerDistance时，根据结束手势时手指的方向切换状态；
//2.2、未超过triggerDistance时，恢复状态；
@property (nonatomic, assign) CGFloat triggerVelocity; //触发状态切换的滚动速度，points/second
@property (nonatomic, assign) CGFloat triggerDistance; //滚动多少距离，可以触发展开和收缩状态切换
@property (nonatomic, strong) UIScrollView *contentView;
- (BOOL)insidePoint:(CGPoint)point WithEvent:(UIEvent *)event;
- (void)setScrollView:(UIScrollView *)contentView;
- (void)displayMax;
- (void)displayMin;
@end

NS_ASSUME_NONNULL_END
